<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>My Blog</title>

    <th:block th:replace="header::common_header" />
    <link rel="stylesheet" href="/md-editor/css/editormd.css">
    <th:block th:replace="header::common_js" />
    <script src="/md-editor/editormd.min.js"></script>
    <script type="text/javascript">
        $(function() {
            var editor = editormd("question-editor", {
                width  : "100%",
                height : "500px",
                path: "/md-editor/lib/",
                watch:false,
                delay:0,
                placeholder:'请输入问题的详细描述',
                imageUpload    : true,
                imageFormats   : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
                imageUploadURL : "/file/upload",
            });
        });
    </script>
</head>
<body>

<div th:insert="~{nav :: nav}"></div>

<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h2><btn class="btn btn-default btn-xs"><span class="glyphicon glyphicon glyphicon-plus" aria-hidden="true"></span></btn> 发起</h2>
            <hr/>
            <form action="/publish" method="post">
                <input type="hidden" name="id" th:value="${id}" />
                <div class="form-group">
                    <label for="title">问题标题（简单扼要）</label>
                    <input  name="title" type="text" class="form-control" id="title" placeholder="请输入标题" th:value="${title}">
                </div>
                <div class="form-group" id="question-editor">
                    <label for="content">补充问题（请根据右侧提示输入内容）</label>
                    <textarea  name="description" class="form-control" id="content" cols="30" rows="10" th:text="${description}" style="display: none"></textarea>
                </div>
                <div class="form-group">
                    <label for="tag">请输入标签</label>
                    <input  name="tag" type="text" class="form-control" id="tag" placeholder="请输入标签" th:value="${tag}">
                </div>
                <div class="form-group" th:if="${error != null}">
                    <span class="alert alert-danger" role="alert"  th:text="${error}" ></span>
                </div>
                <button type="submit" class="btn btn-success form-btn">发布</button>

            </form>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <h3>问题发起指南</h3>
            • 问题标题：请用精简的语言描述您发布的问题，不超过25字<br/>
            • 问题补充：详细补充您的问题内容，并确保问题描述清晰直观，并提供一些相关的资料<br/>
            • 选择标签：选择一个或者多个标签，用逗号隔开，每个不超过10个字<br/>
        </div>
    </div>
</div>
</body>
</html>